package com.dsr.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Entity;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Setter
@Getter
@Entity
@Document
public class Spit implements Serializable {
    @Id
    private String _id;
    private String content;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date publishTime;
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String imgUrl;
    private String userId;
    private String nickname;
    private String peopleIcon;
    private Integer thumbUp;
    private Integer comment;
    private Integer state;
    private String parentId;
    private String flowerId;
    private Integer rate;
    private List<String> imgUrlList=new ArrayList<>();
}
